// 导入静态路由
import { constantRoutes } from '@/router'
export default {
  namespaced: true,
  state() {
    return {
      // 先以静态路由作为菜单数据的初始值
      menuList: [...constantRoutes]
    }
  },
  mutations: {
    // 把动态路由部分添加到菜单
    updateMenuList(state, asyncRoutes) {
      // 将动态路由和静态路由组合起来
    //   state.menuList,push(...asyncRoutes)
      state.menuList = [...constantRoutes, ...asyncRoutes]
    }
  }
}